package org.kfive.nova.design.structture.composite;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by admin on 2017-03-04.
 */
public class ConcreteComposite extends Component {

    private List<Component> components = new ArrayList<Component>();

    public void add(Component component) {
        this.components.add(component);
    }

    public void remove(Component component) {
        this.components.remove(component);
    }

    public Component getChild(int i) {
        return this.components.get(i);
    }

    public void operator() {
        System.out.println("call concretecomposite operator method");
    }
}
